import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.text.Text;
import javafx.stage.Stage;
public class HelloWorld extends Application {

	Text txt;
	Button btn;
	
	public void start(Stage primaryStage) {
		primaryStage.setTitle("Hello World!");

		txt = new Text();
		btn = new Button();

		btn.setText("Fale 'Hello World!'");
		btn.setLayoutX(100);
		btn.setLayoutY(100);
		txt.setLayoutX(120);
		txt.setLayoutY(140);

		btn.setOnAction(new EventHandler<ActionEvent>() {
			@Override
			public void handle(ActionEvent event) {
				txt.setText("Hello World!");
			}
		});

		Group root = new Group();
		root.getChildren().add(btn);
		root.getChildren().add(txt);
		primaryStage.setScene(new Scene(root, 300, 250));
		primaryStage.show();
	}
	public static void main(String[] args) {
		launch(args);
	}
}
